package objetsBd;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author verpoorten
 */
@Entity
@Table(name = "Location")
public class LocationBd implements Serializable ,Cloneable{

    private static final long serialVersionUID = 1L;
    private static final String SEQ_ID = "idLocation_sequence ";
    @Id
    @SequenceGenerator(name = SEQ_ID,
            sequenceName = SEQ_ID, allocationSize = 1)
    @GeneratedValue(generator = SEQ_ID)
    @Column(name = "idLocation")
    private Long idLocation;
    @Column(name = "idBatiment")
    private Long idBatiment;
    @Column(name = "idLocataire")
    private Long idLocataire;
    //
    @Column(name = "bailType")
    private String bailType;
    @Column(name = "bailDuree")
    private Integer bailDuree;
    @Column(name = "bailUniteDuree")
    private String bailUniteDuree;
    @Column(name = "bailDateDebut")
    @Temporal(TemporalType.DATE)
    private Date bailDateDebut;
    @Column(name = "bailDateFin")
    @Temporal(TemporalType.DATE)
    private Date bailDateFin;
    @Column(name = "bailJourQuittance")
    private Integer bailJourQuittance;
    @Column(name = "bailRenom")
    private String bailRenom;
    @Column(name = "bailLoyer")
    private Double bailLoyer;
    @Column(name = "bailCharges")
    private Double bailCharges;
    @Column(name = "locataireActif")
    private Boolean locataireActif;
    @Column(name = "dateDeModif")
    @Temporal(TemporalType.DATE)
    private Date dateDeModif;
    @Column(name = "indexRef")
    private Double indexRef;
    @Column(name = "indexActuel")
    private Double indexActuel;
    @Column(name = "nomProprio")
    private String nomProprio;
    @Column(name = "assuranceProprioIncendie")
    private String assuranceProprioIncendie;

    public static LocationBd parIdLocataire(Long idLocataire) {
        LocationBd batiment = new LocationBd();
        batiment.idLocataire = idLocataire;
        return batiment;
    }

    public static LocationBd parIdBatiment(Long idBatiment) {
        LocationBd batiment = new LocationBd();
        batiment.idBatiment = idBatiment;
        return batiment;

    }

    public static LocationBd parIdLocation(Long idLocation) {
        LocationBd batiment = new LocationBd();
        batiment.idLocation = idLocation;
        return batiment;
    }

    public Long getIdLocation() {
        return idLocation;
    }

    public void setIdLocation(Long idLocation) {
        this.idLocation = idLocation;
    }

    public Long getIdBatiment() {
        return idBatiment;
    }

    public void setIdBatiment(Long idBatiment) {
        this.idBatiment = idBatiment;
    }

    public Double getBailLoyer() {
        return bailLoyer;
    }

    public void setBailLoyer(Double bailLoyer) {
        this.bailLoyer = bailLoyer;
    }

    public Boolean getLocataireActif() {
        return locataireActif;
    }

    public void setLocataireActif(Boolean locataireActif) {
        this.locataireActif = locataireActif;
    }

    public Date getDateDeModif() {
        return dateDeModif;
    }

    public void setDateDeModif(Date dateDeModif) {
        this.dateDeModif = dateDeModif;
    }

    public Long getIdLocataire() {
        return idLocataire;
    }

    public void setIdLocataire(Long idLocataire) {
        this.idLocataire = idLocataire;
    }

    public String getBailType() {
        return bailType;
    }

    public void setBailType(String bailType) {
        this.bailType = bailType;
    }

    public Integer getBailDuree() {
        return bailDuree;
    }

    public void setBailDuree(Integer bailDuree) {
        this.bailDuree = bailDuree;
    }

    public String getBailUniteDuree() {
        return bailUniteDuree;
    }

    public void setBailUniteDuree(String bailUniteDuree) {
        this.bailUniteDuree = bailUniteDuree;
    }

    public Date getBailDateDebut() {
        return bailDateDebut;
    }

    public void setBailDateDebut(Date bailDateDebut) {
        this.bailDateDebut = bailDateDebut;
    }

    public Date getBailDateFin() {
        return bailDateFin;
    }

    public void setBailDateFin(Date bailDateFin) {
        this.bailDateFin = bailDateFin;
    }

    public Integer getBailJourQuittance() {
        return bailJourQuittance;
    }

    public void setBailJourQuittance(Integer bailJourQuittance) {
        this.bailJourQuittance = bailJourQuittance;
    }

    public String getBailRenom() {
        return bailRenom;
    }

    public void setBailRenom(String bailRenom) {
        this.bailRenom = bailRenom;
    }

    public Double getBailCharges() {
        return bailCharges;
    }

    public void setBailCharges(Double bailCharges) {
        this.bailCharges = bailCharges;
    }

    public Double getIndexRef() {
        return indexRef;
    }

    public void setIndexRef(Double indexRef) {
        this.indexRef = indexRef;
    }

    public Double getIndexActuel() {
        return indexActuel;
    }

    public void setIndexActuel(Double indexActuel) {
        this.indexActuel = indexActuel;
    }

    public String getNomProprio() {
        return nomProprio;
    }

    public void setNomProprio(String nomProprio) {
        this.nomProprio = nomProprio;
    }

    public String getAssuranceProprioIncendie() {
        return assuranceProprioIncendie;
    }

    public void setAssuranceProprioIncendie(String assuranceProprioIncendie) {
        this.assuranceProprioIncendie = assuranceProprioIncendie;
    }

    public LocationBd createClone() {
        try {
            return (LocationBd) super.clone();
        } catch (CloneNotSupportedException ex) {
            throw new IllegalStateException(ex);
        }
    }
}
